Integrand size = 32, antiderivative size = 111 \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=a (i A+B) x+\frac {a (i A+B) \cot (c+d x)}{d}+\frac {a (A-i B) \cot ^2(c+d x)}{2 d}-\frac {a (i A+B) \cot ^3(c+d x)}{3 d}-\frac {a A \cot ^4(c+d x)}{4 d}+\frac {a (A-i B) \log (\sin (c+d x))}{d} \]
[Out]
Time = 0.30 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3672, 3610, 3612, 3556} \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {a (B+i A) \cot ^3(c+d x)}{3 d}+\frac {a (A-i B) \cot ^2(c+d x)}{2 d}+\frac {a (B+i A) \cot (c+d x)}{d}+\frac {a (A-i B) \log (\sin (c+d x))}{d}+a x (B+i A)-\frac {a A \cot ^4(c+d x)}{4 d} \]
[In]
[Out]
Rule 3556
Rule 3610
Rule 3612
Rule 3672
Rubi steps \begin{align*} \text {integral}& = -\frac {a A \cot ^4(c+d x)}{4 d}+\int \cot ^4(c+d x) (a (i A+B)-a (A-i B) \tan (c+d x)) \, dx \\ & = -\frac {a (i A+B) \cot ^3(c+d x)}{3 d}-\frac {a A \cot ^4(c+d x)}{4 d}+\int \cot ^3(c+d x) (-a (A-i B)-a (i A+B) \tan (c+d x)) \, dx \\ & = \frac {a (A-i B) \cot ^2(c+d x)}{2 d}-\frac {a (i A+B) \cot ^3(c+d x)}{3 d}-\frac {a A \cot ^4(c+d x)}{4 d}+\int \cot ^2(c+d x) (-a (i A+B)+a (A-i B) \tan (c+d x)) \, dx \\ & = \frac {a (i A+B) \cot (c+d x)}{d}+\frac {a (A-i B) \cot ^2(c+d x)}{2 d}-\frac {a (i A+B) \cot ^3(c+d x)}{3 d}-\frac {a A \cot ^4(c+d x)}{4 d}+\int \cot (c+d x) (a (A-i B)+a (i A+B) \tan (c+d x)) \, dx \\ & = a (i A+B) x+\frac {a (i A+B) \cot (c+d x)}{d}+\frac {a (A-i B) \cot ^2(c+d x)}{2 d}-\frac {a (i A+B) \cot ^3(c+d x)}{3 d}-\frac {a A \cot ^4(c+d x)}{4 d}+(a (A-i B)) \int \cot (c+d x) \, dx \\ & = a (i A+B) x+\frac {a (i A+B) \cot (c+d x)}{d}+\frac {a (A-i B) \cot ^2(c+d x)}{2 d}-\frac {a (i A+B) \cot ^3(c+d x)}{3 d}-\frac {a A \cot ^4(c+d x)}{4 d}+\frac {a (A-i B) \log (\sin (c+d x))}{d} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.91 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.86 \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {a \left (-6 (A-i B) \cot ^2(c+d x)+3 A \cot ^4(c+d x)+4 (i A+B) \cot ^3(c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-\tan ^2(c+d x)\right )-12 (A-i B) (\log (\cos (c+d x))+\log (\tan (c+d x)))\right )}{12 d} \]
[In]
[Out]
Time = 0.20 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.95
method | result | size |
parallelrisch | \(\frac {a \left (\left (-\frac {A}{2}+\frac {i B}{2}\right ) \ln \left (\sec ^{2}\left (d x +c \right )\right )+\left (-i B +A \right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {A \left (\cot ^{4}\left (d x +c \right )\right )}{4}+\left (\cot ^{3}\left (d x +c \right )\right ) \left (-\frac {i A}{3}-\frac {B}{3}\right )+\left (\cot ^{2}\left (d x +c \right )\right ) \left (\frac {A}{2}-\frac {i B}{2}\right )+\cot \left (d x +c \right ) \left (i A +B \right )+\left (i A +B \right ) x d \right )}{d}\) | \(106\) |
derivativedivides | \(\frac {a \left (\frac {\left (i B -A \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (i A +B \right ) \arctan \left (\tan \left (d x +c \right )\right )-\frac {A}{4 \tan \left (d x +c \right )^{4}}-\frac {i B -A}{2 \tan \left (d x +c \right )^{2}}+\left (-i B +A \right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {-i A -B}{\tan \left (d x +c \right )}-\frac {i A +B}{3 \tan \left (d x +c \right )^{3}}\right )}{d}\) | \(119\) |
default | \(\frac {a \left (\frac {\left (i B -A \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (i A +B \right ) \arctan \left (\tan \left (d x +c \right )\right )-\frac {A}{4 \tan \left (d x +c \right )^{4}}-\frac {i B -A}{2 \tan \left (d x +c \right )^{2}}+\left (-i B +A \right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {-i A -B}{\tan \left (d x +c \right )}-\frac {i A +B}{3 \tan \left (d x +c \right )^{3}}\right )}{d}\) | \(119\) |
norman | \(\frac {\frac {\left (i a A +B a \right ) \left (\tan ^{3}\left (d x +c \right )\right )}{d}+\left (i a A +B a \right ) x \left (\tan ^{4}\left (d x +c \right )\right )-\frac {a A}{4 d}+\frac {\left (-i a B +a A \right ) \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {\left (i a A +B a \right ) \tan \left (d x +c \right )}{3 d}}{\tan \left (d x +c \right )^{4}}+\frac {\left (-i a B +a A \right ) \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {\left (-i a B +a A \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(146\) |
risch | \(-\frac {2 a B c}{d}-\frac {2 i a A c}{d}+\frac {2 i a \left (12 i A \,{\mathrm e}^{6 i \left (d x +c \right )}+9 B \,{\mathrm e}^{6 i \left (d x +c \right )}-18 i A \,{\mathrm e}^{4 i \left (d x +c \right )}-18 B \,{\mathrm e}^{4 i \left (d x +c \right )}+16 i A \,{\mathrm e}^{2 i \left (d x +c \right )}+13 B \,{\mathrm e}^{2 i \left (d x +c \right )}-4 i A -4 B \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}-\frac {i a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) B}{d}+\frac {a A \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) | \(160\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 206 vs. \(2 (95) = 190\).
Time = 0.25 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.86 \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {6 \, {\left (4 \, A - 3 i \, B\right )} a e^{\left (6 i \, d x + 6 i \, c\right )} - 36 \, {\left (A - i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (16 \, A - 13 i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} - 8 \, {\left (A - i \, B\right )} a - 3 \, {\left ({\left (A - i \, B\right )} a e^{\left (8 i \, d x + 8 i \, c\right )} - 4 \, {\left (A - i \, B\right )} a e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, {\left (A - i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} - 4 \, {\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - i \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} - 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} - 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 218 vs. \(2 (92) = 184\).
Time = 0.72 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.96 \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {a \left (A - i B\right ) \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac {8 A a - 8 i B a + \left (- 32 A a e^{2 i c} + 26 i B a e^{2 i c}\right ) e^{2 i d x} + \left (36 A a e^{4 i c} - 36 i B a e^{4 i c}\right ) e^{4 i d x} + \left (- 24 A a e^{6 i c} + 18 i B a e^{6 i c}\right ) e^{6 i d x}}{3 d e^{8 i c} e^{8 i d x} - 12 d e^{6 i c} e^{6 i d x} + 18 d e^{4 i c} e^{4 i d x} - 12 d e^{2 i c} e^{2 i d x} + 3 d} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.05 \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {12 \, {\left (d x + c\right )} {\left (i \, A + B\right )} a - 6 \, {\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 12 \, {\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )\right ) - \frac {12 \, {\left (-i \, A - B\right )} a \tan \left (d x + c\right )^{3} - 6 \, {\left (A - i \, B\right )} a \tan \left (d x + c\right )^{2} + 4 \, {\left (i \, A + B\right )} a \tan \left (d x + c\right ) + 3 \, A a}{\tan \left (d x + c\right )^{4}}}{12 \, d} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 282 vs. \(2 (95) = 190\).
Time = 0.85 (sec) , antiderivative size = 282, normalized size of antiderivative = 2.54 \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {3 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 8 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 i \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 120 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 384 \, {\left (A a - i \, B a\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) - 192 \, {\left (A a - i \, B a\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) + \frac {400 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 400 i \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 i \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 8 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]
[In]
[Out]
Time = 8.46 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.90 \[ \int \cot ^5(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {\left (-B\,a-A\,a\,1{}\mathrm {i}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^3+\left (-\frac {A\,a}{2}+\frac {B\,a\,1{}\mathrm {i}}{2}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^2+\left (\frac {B\,a}{3}+\frac {A\,a\,1{}\mathrm {i}}{3}\right )\,\mathrm {tan}\left (c+d\,x\right )+\frac {A\,a}{4}}{d\,{\mathrm {tan}\left (c+d\,x\right )}^4}+\frac {a\,\mathrm {atan}\left (2\,\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{d} \]
[In]
[Out]